{"id":239,"date":"2015-02-26T22:28:29","date_gmt":"2015-02-26T22:28:29","guid":{"rendered":"http:\/\/press3.mcs.anl.gov\/romio\/?p=239"},"modified":"2015-02-26T22:28:29","modified_gmt":"2015-02-26T22:28:29","slug":"lustre-preadpwrite-and-caddr_t","status":"publish","type":"post","link":"https:\/\/wordpress.cels.anl.gov\/romio\/2015\/02\/26\/lustre-preadpwrite-and-caddr_t\/","title":{"rendered":"lustre, pread\/pwrite and caddr_t"},"content":{"rendered":"<p>I just pushed some changes to MPICH master to help ROMIO deal with useful\u00a0 features that might not be available on all platforms and configurations.<br \/>\nThe system calls pread(2) and pwrite(2)\u00a0 act just like read(2) and write(2), but they take an additional offset parameter.\u00a0 The intent was to make life easier for threaded applications, but these system calls help with ROMIO scalablity, too.\u00a0 The lseek(2) system call isn&#8217;t terribly expensive most of the time, but on some platforms with system call forwarding (e.g. Blue Gene\/ Q), the extra system call can contribute to congestion at the system call forwarding interface.<br \/>\nPerhaps foolishly, I defined _XOPEN_SOURCE to 600 in ROMIO.\u00a0\u00a0 this worked fine on all platforms I could test, but some of our Lustre using friends have run into problems.\u00a0\u00a0\u00a0 ROMIO&#8217;s lustre driver includes lustre.h.\u00a0 Lustre.h includes quota.h and quota.h tries to use a caddr_t datatype &#8212; one that is not defined if _XOPEN_SOURCE is set to 600.<br \/>\nThis problem can show up if you are building ROMIO, MPICH, MVAPICH, or OpenMPI with lustre, and looks like this:<\/p>\n<pre>In file included from \/usr\/include\/linux\/lustre_user.h:46,\n                 from \/usr\/include\/lustre\/lustre_user.h:54,\n                 from adio\/ad_lustre\/ad_lustre.h:30,\n                 from adio\/ad_lustre\/ad_lustre_rwcontig.c:20:\n\/usr\/include\/sys\/quota.h:221: error: expected declaration specifiers or\n'...' before 'caddr_t'<\/pre>\n<p>In this case, what I decided to do was simply provide a re-implemented pread\/pwrite in ROMIO if the pread\/pwrite prototypes don&#8217;t exist.<br \/>\nIf you ran into this problem, sorry about that.\u00a0 If you found this page because you are facing a similar problem, please try the latest MPICH.\u00a0 The two changes are the following:<br \/>\n<a title=\"check for pwrite\" href=\"http:\/\/git.mpich.org\/mpich.git\/commit\/4e80e1d2b9e\">http:\/\/git.mpich.org\/mpich.git\/commit\/4e80e1d2b9e<\/a> and <a title=\"don't set XOPEN_SOURCE ourselves\" href=\"http:\/\/git.mpich.org\/mpich.git\/commit\/5a10283bf7\">http:\/\/git.mpich.org\/mpich.git\/commit\/5a10283bf7<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>I just pushed some changes to MPICH master to help ROMIO deal with useful\u00a0 features that might not be available on all platforms and configurations. The system calls pread(2) and pwrite(2)\u00a0 act just like read(2) and write(2), but they take an additional offset parameter.\u00a0 The intent was to make life easier for threaded applications, but &hellip;<\/p>\n","protected":false},"author":362,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[2],"tags":[],"class_list":["post-239","post","type-post","status-publish","format-standard","hentry","category-development"],"acf":[],"_links":{"self":[{"href":"https:\/\/wordpress.cels.anl.gov\/romio\/wp-json\/wp\/v2\/posts\/239","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wordpress.cels.anl.gov\/romio\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/wordpress.cels.anl.gov\/romio\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/wordpress.cels.anl.gov\/romio\/wp-json\/wp\/v2\/users\/362"}],"replies":[{"embeddable":true,"href":"https:\/\/wordpress.cels.anl.gov\/romio\/wp-json\/wp\/v2\/comments?post=239"}],"version-history":[{"count":0,"href":"https:\/\/wordpress.cels.anl.gov\/romio\/wp-json\/wp\/v2\/posts\/239\/revisions"}],"wp:attachment":[{"href":"https:\/\/wordpress.cels.anl.gov\/romio\/wp-json\/wp\/v2\/media?parent=239"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/wordpress.cels.anl.gov\/romio\/wp-json\/wp\/v2\/categories?post=239"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/wordpress.cels.anl.gov\/romio\/wp-json\/wp\/v2\/tags?post=239"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}