Jump to content

Search the Community

Showing results for tags 'openmp'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Bulletin Centre
    • Community News
    • Repository News
    • Ragnarok News
  • Hercules Development Centre
    • Development Discussion
    • Suggestions
    • Development Centre Archives
  • Support & Releases
    • General Server Support
    • Database
    • Scripting
    • Source
    • Plugin
    • Client-Side
    • Graphic Enhancements
    • Other Support & Releases
  • Hercules Community
    • General Discussion
    • Projects
    • Employment
    • Server Advertisement
    • Arts & Writings
    • Off Topic
  • 3CeAM Centre
    • News and Development
    • Community
  • International Communities
    • Filipino Community
    • Portuguese Community
    • Spanish Community
    • Other Communities

Categories

  • Client Resources
  • Graphic Resources
    • Sprites & Palettes
    • Maps & Textures
    • Other Graphics
  • Server Resources
    • Server Managers / Editors Releases
    • Script Releases
    • Source Modifications
    • Plugins
    • Pre-Compiled Server
  • Web Resources

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Discord


Skype


IRC Nickname


Website URL


Location:


Interests


Github

Found 1 result

  1. Hello Community, i was wondering why the Hecules isnot optimezed to use all the thread of the cpu... Hands on that, i try by myself doing some mods at the source and got no problems while compiling and using the modified source to play, here is a example: /src/char/char.c original: int mapif_sendall(unsigned char *buf, unsigned int len){ int i, c; nullpo_ret(buf); c = 0; for(i = 0; i < ARRAYLENGTH(chr->server); i++) { int fd; if ((fd = chr->server[i].fd) > 0) { WFIFOHEAD(fd,len); memcpy(WFIFOP(fd,0), buf, len); WFIFOSET(fd,len); c++; } } return c;} parallel: #include <omp.h>int mapif_sendall(unsigned char *buf, unsigned int len){ int i, c; nullpo_ret(buf); c = 0; #pragma omp parallel reduction(+:c) //reduction to prevent race condition on c { #pragma omp for schedule(static) //will devide i/thread for(i = 0; i < ARRAYLENGTH(chr->server); i++) { int fd; if ((fd = chr->server[i].fd) > 0) { WFIFOHEAD(fd,len); memcpy(WFIFOP(fd,0), buf, len); WFIFOSET(fd,len); c++; } } } return c;} So... Why not use? Just by respecting some rules and including one more library we can make a very efficient code with the same code...
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.